<?php
require_once ('includes/functions/general.php');

    $currentUrl = $_SERVER['PHP_SELF'];   
    //echo "query string ".$_SERVER['QUERY_STRING']; 
    $engUrl=''; $frUrl='';    
    if(strlen($_SERVER['QUERY_STRING'])==0){
        $engUrl = $currentUrl."?langue=en";
        $frUrl = $currentUrl."?langue=fr";        
    }else{
        if(strpos($_SERVER['QUERY_STRING'], 'langue=en')!== false){
            
            $engUrl = $currentUrl . "?" . $_SERVER['QUERY_STRING'];
            $frUrl = $currentUrl . "?" . str_replace("langue=en","langue=fr", $_SERVER['QUERY_STRING']);
        }else if(strpos($_SERVER['QUERY_STRING'], "langue=fr") !== false){
            
            $frUrl = $currentUrl . "?" . $_SERVER['QUERY_STRING'];
            $engUrl = $currentUrl . "?" . str_replace("langue=fr","langue=en", $_SERVER['QUERY_STRING']);
        }else{
            
            $frUrl = $currentUrl . "?" . $_SERVER['QUERY_STRING'] . "&langue=fr";
            $engUrl = $currentUrl . "?" . $_SERVER['QUERY_STRING'] . "&langue=en";
        }    
    }
    
?>
            <div id="top">
                <!--
<div class="logo">
                    <a href="<?php echo tep_embed_langue_url("index.php"); ?>" ><img src="<?php echo LOGO; ?>" alt="Tintamar Intelligent daily" /></a>
                </div> 
-->               
                <div class="language">
                    <a href="<?php echo tep_encode_specialchars($engUrl);?>" ><img src="images/tintamar/flag_en.png" alt="English" /></a>
                    <a href="<?php echo tep_encode_specialchars($frUrl);?>" ><img src="images/tintamar/flag_fr.png" alt="French" /></a>
                </div>
                
                
           </div>